Start migration to the `failure` crate
authorAlex Crichton <alex@alexcrichton.com>
Fri, 8 Dec 2017 19:31:17 +0000 (11:31 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 Dec 2017 01:48:36 +0000 (17:48 -0800)
commit37cffbe0a3e921a7873cdab563331b33a4450220
tree0655adff3b92810c5d9228a94e47879309f28257
parent4bbfc70da98bc00edb5c0e04d32326b270753f2e
Start migration to the `failure` crate

This commit is the initial steps to migrate Cargo's error handling from the
`error-chain` crate to the `failure` crate. This is intended to be a low-cost
(in terms of diff) transition where possible so it's note "purely idiomatic
`failure` crate" just yet.

The `error-chain` dependency is dropped in this commit and Cargo now canonically
uses the `Error` type from the `failure` crate. The main last remnant of
`error-chain` is a custom local extension trait to use `chain_err` instead of
`with_context`. I'll try to follow up with a commit that renames this later but
I wanted to make sure everything worked first! (and `chain_err` is used
practically everywhere).

Some minor tweaks happened in the tests as I touched up a few error messages
here and there but overall the UI of Cargo should be exactly the same before and
after this commit.
67 files changed:
Cargo.toml
src/bin/bench.rs
src/bin/cargo.rs
src/bin/check.rs
src/bin/help.rs
src/bin/install.rs
src/bin/locate_project.rs
src/bin/login.rs
src/bin/owner.rs
src/bin/publish.rs
src/bin/run.rs
src/bin/rustc.rs
src/bin/search.rs
src/bin/test.rs
src/bin/yank.rs
src/cargo/core/dependency.rs
src/cargo/core/manifest.rs
src/cargo/core/package.rs
src/cargo/core/package_id_spec.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/source/source_id.rs
src/cargo/core/workspace.rs
src/cargo/lib.rs
src/cargo/ops/cargo_clean.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_doc.rs
src/cargo/ops/cargo_install.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_package.rs
src/cargo/ops/cargo_read_manifest.rs
src/cargo/ops/cargo_run.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/ops/cargo_rustc/job_queue.rs
src/cargo/ops/cargo_rustc/layout.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/ops/cargo_test.rs
src/cargo/ops/lockfile.rs
src/cargo/ops/registry.rs
src/cargo/sources/config.rs
src/cargo/sources/directory.rs
src/cargo/sources/git/source.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/path.rs
src/cargo/sources/registry/index.rs
src/cargo/sources/registry/mod.rs
src/cargo/sources/registry/remote.rs
src/cargo/sources/replaced.rs
src/cargo/util/cfg.rs
src/cargo/util/config.rs
src/cargo/util/errors.rs
src/cargo/util/flock.rs
src/cargo/util/important_paths.rs
src/cargo/util/mod.rs
src/cargo/util/network.rs
src/cargo/util/paths.rs
src/cargo/util/process_builder.rs
src/cargo/util/to_semver.rs
src/cargo/util/to_url.rs
src/cargo/util/toml/mod.rs
src/crates-io/Cargo.toml
src/crates-io/lib.rs
tests/build.rs
tests/cargotest/support/mod.rs
tests/doc.rs
tests/install.rs